package paperockscissors;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;



public class Player {
	
	private final int nbrMoves = 10;
	private String name;
	private int score;
	private List<RPSEnum> moves;
	private Iterator<RPSEnum> i;
	
	public Player(String name, List<RPSEnum> moves){
		this.name = name;
		this.moves = moves;
	}
	public Player(String name){
		this.name = name;
		this.moves = new ArrayList<RPSEnum>();
		Random rand = new Random();
	
		for (int i=0;i<this.nbrMoves;i++){
			switch(rand.nextInt(4)){
			case 0:
				moves.add(RPSEnum.LIZARD);
			break;
			case 1:
				moves.add(RPSEnum.PAPER);
			break;
			case 2:
				moves.add(RPSEnum.ROCK);
			break;
			case 3:
				moves.add(RPSEnum.SCISSORS);
			break;
			case 4:
				moves.add(RPSEnum.SPOCK);
			break;
			}	
		}
		i = moves.iterator();
	}
		
	public String getName(){
		return this.name;
	}
	public int getScore(){
		return this.score;
	}
	public void setScore(int score){
		this.score = score;
	}
	public int getNbrMoves(){
		return this.nbrMoves;
	}
	public RPSEnum getNextMove(){
		return (RPSEnum) i.next();

		
	}
}
